package uc;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

public class NoScrollListView extends ListView {

	/*private int startX;
	private int startY;*/

	public NoScrollListView(Context context, AttributeSet attrs, int defStyleAttr) {

		super(context, attrs, defStyleAttr);
	}

	public NoScrollListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public NoScrollListView(Context context) {
		super(context);
	}
	@Override
	public boolean dispatchTouchEvent(MotionEvent ev) {
		getParent().requestDisallowInterceptTouchEvent(true);
		return super.dispatchTouchEvent(ev);
	}
	/*@Override
	public boolean onInterceptTouchEvent(MotionEvent arg0) {
		switch (arg0.getAction()) {
		case MotionEvent.ACTION_DOWN:
			startX = (int) arg0.getX();
			startY = (int) arg0.getY();
			break;
		case MotionEvent.ACTION_MOVE:
			int moveX = (int) arg0.getX();
			int moveY = (int) arg0.getY();

			if (Math.abs(moveX - startX) < Math.abs(moveY - startY)) {
				return true;
			}
			break;

		default:
			break;
		}
		return false;
	}*/

}
